<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.active{
				color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<h2 class="active">{{message}}</h2>
			<h2 :class="active">{{message}}</h2>
			
			<!-- 对象写法 -->
			<!-- <h2 v-bind:class="{类名:Boolean,类名:Boolean}">{{message}}</h2> -->
			<h2 v-bind:class="{active:true,line:true}">{{message}}</h2>
			<!-- 将布尔值变为data的值,可以在命令行中动态控制多个类名 -->
			<!-- 在命令行中输入app.isActive = false -->
			<h2 :class="{active:isActive,line:isLine}">{{message}}</h2>		
			<button type="button" v-on:click="btnClick">点击</button>
		
			<!-- 将class固定写好 -->
			<h2 class="title" :class="{active:isActive,line:isLine}">{{message}}</h2>
		</div>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			const app = new Vue({
				el: "#app",
				data: {
					message: "hello",
					active: "active",
					isActive : true,
					isLine : true
				},
				methods: {
					btnClick:function(){
						this.isActive = !this.isActive;
					}
				}
			})
		</script>
	</body>
	
</html>
